package com.fss.cart.mapper;


import com.fss.cart.domain.CartProduct;
import com.fss.cart.domain.MyItem;
import com.fss.cart.domain.MyProductItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface CartMapper {


    void add(@Param("skuId")long skuId, @Param("cartId") long cartId,  @Param("quantity")Integer quantity,@Param("productId") long productId);


    Long getCartIdByUserId(long userId);

    void createCart(long userId);

    List<MyProductItem> findByUserId(long cartId);

    List<CartProduct> getCartProductsByCartId(Long cartId);

    Integer getStockBySkuId(Long skuId);

    void deleteCartItems(@Param("ids")List<Long> ids);

    void updateCartItem(@Param("id")Long id,@Param("quantity") Integer quantity);
}
